<template>
  <div class="layout-padding">
    <div>
      <el-row>
        <el-col :span="24">
          <div class="dashboard-title">
            <h1>欢迎使用跃豆云物业管理系统</h1>
          </div>
        </el-col>
      </el-row>
<!--      <el-row :gutter="20">-->
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('twin')">-->
<!--            数字孪生智慧农业园区管理系统-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <el-button @click="goAdmin('bigdata')">农业大数据中心</el-button>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <el-button @click="goAdmin('tracing')">产品追溯</el-button>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <el-button @click="goAdmin('training')">种植技能培训</el-button>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <el-button @click="goAdmin('science')">中小学科普</el-button>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <el-button @click="goAdmin('security')">智能安防</el-button>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <el-button @click="goAdmin('all')">系统后台</el-button>-->
<!--        </el-col>-->
<!--      </el-row>-->
      <el-row :gutter="20" style="padding: 20px;">

        <el-col :span="6" v-for="item in list" >
          <div class="grid-content bg-purple" @click="goAdmin('all')">
            {{item.label}}
          </div>
        </el-col>
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('all')">-->
<!--            农业大数据中心-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('all')">-->
<!--            产品追溯平台-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('all')">-->
<!--            种植技能培训平台-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('all')">-->
<!--            中小学科普平台-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('all')">-->
<!--            智能安防平台-->
<!--          </div>-->
<!--        </el-col>-->
<!--        <el-col :span="6">-->
<!--          <div class="grid-content bg-purple" @click="goAdmin('all')">-->
<!--            系统后台-->
<!--          </div>-->
<!--        </el-col>-->
      </el-row>

    </div>
  </div>
</template>

<script setup lang="ts" name="dashboardIndex">
import { NextLoading } from '/@/utils/loading';
import { Session } from '/@/utils/storage';
import {useUserInfo} from "/@/stores/userInfo";
import { useRoutesList } from '/@/stores/routesList';
import pinia from '/@/stores/index';
import {useDict} from "/@/hooks/dict";

const router = useRouter();
const list = useDict('platform_name').platform_name;
/**
 * 跳转到相应模块去。
 */
const goAdmin = async (type:string) => {
  // router.push({path:'/'})
  Session.set('platform', type);

  // 跳转系统导航页面
  const routeUrl = router.resolve({
    path: '/',
  })
  window.open(routeUrl.href,'_blank');
  // const stores = useRoutesList(pinia);
  // stores.setPlatform(type);
  // console.log('stores.platform',stores.platform)
  // console.log('stores.platform',new Date())
};

// 页面加载时
onMounted(() => {
  NextLoading.done();
});
</script>

<style lang="scss" scoped>
.dashboard-title {
  text-align: center;
  margin-bottom: 20px;
  height: 100px;
  line-height: 100px;
}

.el-row {
  margin-bottom: 20px;
  &:last-child {
     margin-bottom: 0;
   }
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  cursor: pointer;
  height: 100px;
  line-height: 100px;
  border-radius: 4px;
  min-height: 36px;
  text-align: center;
  margin-top: 20px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
